<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //	Map类型是键值对的有序列表,键和值是任意类型
        let map = new Map();
        map.set("name","张三");
        map.set("age",10);
        // console.log(map.size);
        // console.log(map.get("age"));
        // map.delete("name")
        // console.log(map.has("name"));
        // map.clear()
        console.log(map);
        // 遍历集合
        // map.forEach((item,key)=>{
        //     console.log(key,item);
        // })
        for (const item of map) {
            console.log(item);
            // console.log(item[0]+":"+item[1]);
        }

        let map2 = new Map([
            ["name","jk"],
            ["age",10]
        ])
        console.log(map2);
    </script>
</body>
</html>